<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>

    <!--_self-->
    <!--_blank-->
    <a href="http://www.baidu.com" target="_blank" name='ccc'>click</a>

    <button id="btn">打开新窗口</button>
    
    <button id="moveBtn">移动</button>


    <script>
        //dom--控制我们可见的节点
        //BOM--浏览器的操作


        //window.open--打开浏览器

        //窗口|全局
        document.getElementById('btn').onclick=function()
        {
            // window.open('http://www.baidu.com')
            // window.open(url,name,窗口配置)
            //  window.open('','myWindow','width=800,height=800')
            myWindow = window.open('','myWindow','width=800,height=800')

            myWindow.alert('这是我的新窗口')
             console.log(myWindow)
        }

        document.getElementById('moveBtn').onclick=function()
        {
            console.log(myWindow)


            //将新打开的窗口向x和y轴方向移动指定距离
            // myWindow.moveTo(100,100)
            myWindow.moveBy(100,100)
        }




    </script>
</body>
</html>